package com.hellobike.haxing.modules.wms.facade;

import com.hellobike.haxing.modules.wms.entity.CodeHolderPoint;
import com.hellobike.haxing.modules.wms.entity.Container;
import com.hellobike.haxing.modules.wms.entity.PickHeader;
import com.hellobike.haxing.modules.wms.exception.WmsServiceException;

/**
 * 拣货app服务
 */
public interface WmsAppPickFacade {

    /**
     * 查询拣货单
     *
     * @param orderCode
     * @return
     */
    PickHeader queryPickHeaderByOrderCode(String orderCode,Long warehouseId) throws WmsServiceException;

    /**
     * 查询当前扫描箱号
     *
     * @param boxCode
     * @return
     * @throws WmsServiceException
     */
    Container queryBox(String boxCode,Long warehouseId) throws WmsServiceException;

    /**
     * 按箱拣货
     *
     * @param pickHeaderId
     * @param boxId
     * @param barcode
     * @throws WmsServiceException
     */
    String pickByBoxAndSku(Long pickHeaderId, Long boxId, String barcode, Long warehouseId, Integer userId) throws WmsServiceException;

    /**
     * 直接拣货（无箱）
     *
     * @param pickHeaderId
     * @param barcode
     * @throws WmsServiceException
     */
    String pickBySku(Long pickHeaderId, String barcode, Long warehouseId, Integer userId) throws WmsServiceException;


    /**
     * 拣货完成
     *
     * @param pickHeaderId
     * @throws WmsServiceException
     */
    void pickCompleted(Long pickHeaderId, Long warehouseId, Integer userId) throws WmsServiceException;

    /**
     * 查询码托点
     *
     * @param pointCode
     * @param warehouseId
     * @return
     * @throws WmsServiceException
     */
    CodeHolderPoint queryPoint(String pointCode, Long warehouseId) throws WmsServiceException;

    /**
     * 绑定当前码托点
     *
     * @param pickHeaderId
     * @param pointId
     * @throws WmsServiceException
     */
    void bindPoint(Long pickHeaderId, Long pointId, Long warehouseId, Integer userId) throws WmsServiceException;

    /**
     * 拣货撤销
     * @param pickHeaderId
     * @param boxId
     * @param barcode
     * @param warehouseId
     * @param userId
     * @return
     * @throws WmsServiceException
     */
    String unPick(Long pickHeaderId, Long boxId, String barcode, Long warehouseId, Integer userId) throws WmsServiceException;
}
